package text;

import java.util.Random;
import java.util.Scanner;


public class text1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一串字符");
        String str = sc.next();
        char[] arr = str.toCharArray();
        System.out.println(randomSort(arr));

    }

    public static String randomSort(char[] arr) {
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            char temp = arr[i];
            int randomIndex = r.nextInt(arr.length);
            arr[i] = arr[randomIndex];
            arr[randomIndex] = temp;
        }
        return new String(arr);
    }
}
